import request from '@/utils/request'

// 查询业务-SMB管理列表
export function listSmbMgmt(query) {
  return request({
    url: '/business/smbMgmt/list',
    method: 'get',
    params: query
  })
}

// 查询业务-SMB管理详细
export function getSmbMgmt(id) {
  return request({
    url: '/business/smbMgmt/' + id,
    method: 'get'
  })
}

// 新增业务-SMB管理
export function addSmbMgmt(data) {
  return request({
    url: '/business/smbMgmt',
    method: 'post',
    data: data
  })
}

// 修改业务-SMB管理
export function updateSmbMgmt(data) {
  return request({
    url: '/business/smbMgmt',
    method: 'put',
    data: data
  })
}

// 删除业务-SMB管理
export function delSmbMgmt(id) {
  return request({
    url: '/business/smbMgmt/' + id,
    method: 'delete'
  })
}

// 导出文件
export function exportExcel(data){
  return request({
    url: '/business/smbMgmt/export',
    method: 'post',
    data: data
  })
}

// 测试连接
export function testConnection(data){
  return request({
    url: '/business/smbMgmt/testConnection',
    method: 'post',
    data: data
  })
}

// 状态变更
export function updateChangeStatus(data){
  return request({
    url: '/business/smbMgmt/changeStatus',
    method: 'put',
    params: data
  })
}

// 挂载状态变更
export function updateChangeMountStatus(data){
  return request({
    url: '/business/smbMgmt/changeMountStatus',
    method: 'put',
    params: data
  })
}

// 查询是否存在已挂载的SMB
export function isExistMountSMB(){
  return request({
    url: '/business/smbMgmt/isExistMountSMB',
    method: 'get',
  })
}

// 刷新缓存
export function refreshCache() {
  return request({
    url: '/business/smbMgmt/refreshCache',
    method: 'delete'
  })
}
